package com.suray.basic.wcs.plc.utils;

public enum LifterLocationType {
    INSIDE(3, "提升机内"),
    LEFT(1, "提升机左"),
    RIGHT(2, "提升机右"),
    PALLET_UP(4, "托盘升"),
    PALLET_DOWN(5, "托盘降"),
    INVALID_CAR_LOCATION(6, "两向车未到位"),
    INVALID_PALLET_LOCATION(7, "托盘未到位"),
    ;

    int value;
    String des;
    LifterLocationType(int value, String des) {
        this.value = value;
        this.des = des;
    }

    public int getValue() {
        return value;
    }

    public String getDes() {
        return des;
    }

    public static LifterLocationType parseLocal(String des) {
        for (LifterLocationType local : LifterLocationType.values()) {
            if (local.des.equals(des)) {
                return local;
            }
        }

        throw new RuntimeException("转换LifterLocal失败:" + des);
    }

    public static LifterLocationType parseLocal(int value) {
        for (LifterLocationType local : LifterLocationType.values()) {
            if (local.value == value) {
                return local;
            }
        }

        throw new RuntimeException("转换LifterLocal失败:" + value);
    }

    @Override
    public String toString() {
        return des;
    }
}
